package com.ming.demo.web.impl.admin;

import com.github.pagehelper.PageHelper;
import com.ming.demo.bean.Result;
import com.ming.demo.model.File;
import com.ming.demo.service.FileFindImage;
import com.ming.demo.service.FileService;
import com.ming.demo.web.admin.AdminFileFindImageController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/image")
public class AdminFileFindImageControllerImpl implements AdminFileFindImageController {
    @Autowired
    private FileService fileService;

    @Autowired
    private FileFindImage fileFindImage;

    @Override
    @RequestMapping("/listMappingImage")
    public Result<List<String>> listResult(int pageNo, int pageSize, String infoPeople_id) {
        PageHelper.startPage(pageNo, pageSize);
        return fileFindImage.listResult(infoPeople_id);
    }

    @Override
    @RequestMapping("/listFindByImageUrl")
    public Result<List<File>> listFindByInageUrl(String name, int pageNo, int pageSize, String infoPeople_id) {
        PageHelper.startPage(pageNo, pageSize);
        return fileFindImage.listFindByIsUrlImage(name, infoPeople_id);
    }
}
